include("shared.lua");

-- Called when it's time to draw the entity.
function ENT:Draw()
	self:DrawModel();
end;

-- Hook a usermessage to recieve resource drop info.
usermessage.Hook("gms_SetResourceDropInfo", function(um)
	local index = um:ReadLong();
	local entType = um:ReadString();
	local amount = um:ReadShort();
	
	local entity = ents.GetByIndex(index);
	
	if (entity == NULL or !entity or !entity:IsValid()) then
		local info = {
			Type = entType,
			Amount = amount,
			Index = index
		};
		
		table.insert(GMS.DropQuery, info);
	else
		entity.Res = entType;
		entity.Amount = amount;
	end;
end);